home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
64-bit_x64
/
Russian
/
cpsimage.cab
/
data
/
xipsup.ucm
< prev
Wrap
Text File
|
2009-04-23
|
27KB
|
500 lines
#
# XIPIMAGE Object and support objects for ELF interpreter
#
# M.Campanelli
# May 2004
#
# For a description of how this file works, see Appendix C of
# Architecture document at XIPS web page.
# http://codex.xerox.com/projects/xips or
# http://xin.xeroxlabs.com/xips
#
<DESCRIPTION>
desc: This file contains the basic object descriptions for connecting XEngine/XFlow image processing \
technology with the ELF interpreter. These descriptions are used by the interpreter to \
define objects and methods the interpreter can use. It is also used to code generate \
compilable code which improves the interpreters performance. This file also contains a set a \
small set of static function declarations that have there own descriptions. \
Simply follow the links.
<OBJECTS>
[XIPCOLOR]
public: c INTEGER ARRAY Desc=Separation values
public: photometry INTEGER Desc=Photometry values
method: getSeps Native=XIPCOLORMethods@xipsup \
Output=seps.INTEGER \
Desc=Return number of seps for this color photometry
desc: {
// DESCRIPTION
A XIPCOLOR object holds color information for XIPLAYER's. Layer types XIP_ContoneMask,
XIP_ColorMask, and XIP_ColorRectangle will have information about the color in the layer.
The 'c' member is typically an array of 1 to 4 values; 1 sep gray, 3 seps color, 4 is CMYK.
You can set or get these values as shown in the following examples;
XIPCOLOR color = new (XIPCOLOR, c: (128, 234, 45, 200), photometry: XIP_CMYK_COLOR);
or, if never set or doing a total overwrite,
color.c = (128, 234, 45, 200);
or, if the array exists, i.e., has already been initialized,
color.c[0] = 128;
color.c[1] = 234;
...
Note, if the object starts as a simple declaration the 'c' array will be NULL. In this
case you need to initialize it via the LIST assignment, i.e., xx = (xx, xx, xx, xx), which
serves as an array allocation.
The following demonstrates Getting values from the object;
INTEGER i1 = color.c[0];
INTEGER i2 = color.c[1];
...
You can also locally capture the array as a LIST, e.g.,
LIST l = color.c;
print l;
}
[XIPHDR]
private: pad INTEGER ARRAY Desc=padding bytes/scanLines
private: compression INTEGER Desc=compression type
private: interleave INTEGER Desc=interleave Scan=0, Pix=1, Frame=2
private: photometry INTEGER Desc=color space photometry
private: seps INTEGER Desc=separations in image
private: bytes INTEGER ARRAY Desc=bytes/scanLines
private: bits INTEGER ARRAY Desc=bits/pixel in image
private: scanlines INTEGER Desc=scanlines in images
private: pixels INTEGER Desc=pixels in image
private: format INTEGER Desc=image data type, i.e., XEngine\
or Pixr
private: endianType INTEGER Desc=byte order of image data
private: border INTEGER Desc=Width of processing frame around\
image, usually Pixr formats
private: alignment INTEGER Desc=alignment of image data
private: clientData "struct _ELFLIST*" Desc=Holds arbitrary client data
private: extraData "void* private" Desc=Holds arbitrary header data
[XIPTEXT]
private: format INTEGER Desc=tells what type of formatting \
the data is in
private: charCount INTEGER Desc=tells number of characters
private: qcharCount INTEGER Desc=tells number of questionable characters
private: ucharCount INTEGER Desc=tells number of unrecognized characters
private: wordCount INTEGER Desc=tells number of words counted
private: render BOOLEAN Desc=Do we flatten into the image or \
not. This means that the text become \
rasterized.
[XIPLAYER]
public: mediaColor XIPCOLOR Desc=Background color, only for Contone
public: color XIPCOLOR Desc=Layer color, only for \
ColorMask and ColorRectangle
public: layerType INTEGER Desc=See defined constants for types
public: ypos DOUBLE Desc=Location wrt original image
public: xpos DOUBLE Desc=Location wrt original image
public: height DOUBLE Desc=Height of layer object
public: width DOUBLE Desc=Width of layer object
public: yres DOUBLE Desc=Original image y resolution
public: xres DOUBLE Desc=Original image x resolution
public: opacity DOUBLE Desc=Object opacity, zero to one
public: rotation DOUBLE Desc=Set layer rotation
public: visibility BOOLEAN Desc=Is this layer visible, def; TRUE
private: text "struct _ELFXIPTEXT*" Desc=Value field for Text layer
private: hdr "struct _ELFXIPHDR*" Desc=Holds raster data parameters
private: data "struct _ELFPOINTER*" Desc=ptr to data, image or other
private: clientData "struct _ELFLIST*" Desc=Holds arbitrary client data
# items below are to administer layer processing
private: flags INTEGER Desc=private flags
private: memoryNode INTEGER Desc=Does this object have a xipWriteMem \
node set, 0=no, 1=yes
private: outputNum INTEGER Desc=output number for XFlow process
private: outputLinks INTEGER Desc=outputs connected to this node
private: xfhandle "void* private" Desc=XFlow XEngine handle
private: parentObj "struct _ELFOBJECT*" Desc=Ptr to parent object
private: arglist "struct _ELFLIST*" Desc=arguments for the desired cmd
private: NODE_ID INTEGER Desc=XFLow node ID
private: attributes "struct _ELFLIST*" Desc=General purpose stuff
method: toImg Native=XIPMethods@xipsup \
Output=img.XIPIMAGE \
Desc=!XIPLayer2XIPIMAGE Upgrade the XIPLAYER to an \
XIPIMAGE object
method: setAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i, obj.OBJECT \
Desc=!XIPAttributes Set named parameters into the object \
attributes. If the name is already there, it will be \
replaced with the new value.
method: getAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i \
Output=obj.OBJECT \
Desc=!XIPAttributes Get the named attribute. If no name \
is passed in, the entire list is returned;
method: clearAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i \
Desc=!XIPAttributes Clear the named attribute. If no \
name is passed in, the entire list is removed;
[XIPIMAGE]
public: info STRING Desc=General purpose information string
public: imageWidth INTEGER Desc=Original image width
public: imageHeight INTEGER Desc=Original image height
public: resolution DOUBLE ARRAY Desc=Original image resolution
public: nlayers INTEGER Desc=How many layers does it have
# public: layers ELFLIST Desc=List of layers
private: layers "struct _ELFLIST*" Desc=List of layers
private: other "struct _ELFPOINTER*" Desc=other data
private: xipservice "void* private" Desc=XIPService structure
private: clientData "struct _ELFLIST*" Desc=Client data
private: attributes "struct _ELFLIST*" Desc=General purpose stuff
method: getSize Native=XIPMethods@xipsup \
Output=size.INTEGER \
Desc=Returns the size in bytes of the object. This \
includes all data held by the object. It does not \
include header information. Depending on the output, \
take the nlayers value and multiply by an adjustment \
factor.
method: setAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i, obj.OBJECT \
Desc=!XIPAttributes Set named parameters into to object \
attributes. If the name is already there, it will be \
replaced with the new value.
method: getAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i \
Output=obj.OBJECT \
Desc=!XIPAttributes Get the named attribute. If no name \
is passed in, the entire list is returned;
method: clearAttr Native=XIPMethods@xipsup \
Input=name.STRING, num.i \
Desc=!XIPAttributes Clear the named attribute. If no \
name is passed in, the entire list is removed;
method: getMember Native=XIPMethods@xipsup \
Input=section.STRING, member.STRING, mindex.i, num.i Output=value.OBJECT \
Desc=!XIPMethod_get Return the value of the nth \
layer XIPLAYER member requested. If no layer exists \
nothing is returned.
method: setMember Native=XIPMethods@xipsup \
Input=member.STRING, num.i, value.OBJECT \
Desc=!XIPMethod_set sets the member value of the nth \
layer XIPLAYER. If no layer exists nothing is set.
method: getLayer Native=XIPMethods@xipsup \
Input=num.INTEGER Output=img.XIPIMAGE \
Desc=Return an XIPIMAGE if the layer exists. Layers \
are indexed with zero reference.
method: exec Native=XIPMethods@xipsup \
Input=save.STRING, perfLog.s, perfLevel.i, watchdog.i \
Output=img.XIPIMAGE \
Desc=Execute deferred image path workflow to the \
current point.
method: unCompress Native=XIPMethods@xipsup \
Input=type.INTEGER, binarytype.BOOLEAN, contonetype.BOOLEAN \
Output=img.XIPIMAGE \
Desc=!__xipsUnCompress General decompression selection
method: compress Native=XIPMethods@xipsup \
Input=type.STRING, profile.i, quality.i, jquality.i, \
sample.LIST, binarytype.STRING, contonetype.STRING, \
lossless.BOOLEAN, force.BOOLEAN \
Output=img.XIPIMAGE \
Desc=!__xipsCompress General compression selection
method: addLayer Native=XIPMethods@xipsup \
Input=image.OBJECT, lindex.i, ltype.i, \
width.DOUBLE, height.DOUBLE, xpos.DOUBLE, ypos.DOUBLE, \
color.XIPCOLOR, mediaColor.XIPCOLOR \
Output=img.XIPIMAGE \
Desc=!XIPMethod_addLayer Add the layer from the input \
image at lindex to the parent XIPIMAGE object. The \
input image can be either a XIPIMAGE or XIPLAYER
method: deleteLayer Native=XIPMethods@xipsup \
Input=num.i, name.s \
Output=img.XIPIMAGE \
Desc=!XIPDeleteLayer Delete the specified layer from the input image
method: setTransform Native=XIPLazyOp@xipsup \
Input=op.STRING, factor.d, upi.d, posx.d, posy.d, \
width.d, height.d, orient.s, std.s, angle.d, mode.s \
Output=img.XIPIMAGE \
Desc=Set transform information for the object. Operations \
can be rotate, scale, position, or center. Note that this \
alters the image and layer parameters in place, a copy of \
the image is not made.
method: seq2imageList Native=XIPMethods@xipsup \
Input=lindex.i \
Output=list.LIST \
Desc=!__XIPMethod_seq2list Convert an image sequence \
layer into an LIST of discrete XIPIMAGE objects.
desc: {
// DESCRIPTION
The XIPIMAGE object can be thought of as analogous to a page. Just as a page can be made up
of several objects, so too a XIPIMAGE can hold one to many layers with different layer types; see
Defined Contants for the LayerTypes allowed.
In general, the methods of a XIPIMAGE mean that the input to this object is at least one XIPIMAGE;
some methods will take more than one image in. The output will very between a XIPIMAGE, XIPINFO object,
or nothing at all. In the latter case the final node is terminal, as in writers.
The processing model is deferred where possible. The reason for this is to maintain performance. Where
possible, execution of an existing deferred group may have to be resolved to provide information. In
some cases it is not always detectable. For non terminal nodes you can always force the resolution via
the exec() method. For ex.,
XIPIMAGE img = readimage (filename: myfile).cspace (outspace: "gray").exec();
The value of img will be fully realized after this statement because of the exec() method. If a list
of deferred operations are terminal, then you can use the static function Execute (). This will
resolve any terminal deferred processes. For ex.,
img.display (title: myfile);
img.writepng (filename: myfile.name() + ".png");
img.writetif (filename: myfile.name() + ".tif");
img.writebmp (filename: myfile.name() + ".bmp");
Execute ();
All these operations are deferred until the Execute () or the end of the script. As a final warning,
situations have come up where within a script a file is consumed, processed, written to disc, then
tried to be consumed again. The problem here is the deferred processing, unless and Execute() is
used before trying to re-consume the output it may not exist.
}
[XIPINFO]
public: name STRING DESC=Name of the module that produced this object
private: data "struct _ELFPOINTER*" Desc=Attach XEngine info data here
private: infofields "void* private" Desc=XEngine XEngInfoFields
private: hdr "void* private" Desc=XEngine XEngHeaderStruct
private: xfhandle "void* private" Desc=XFlow XEngine handle
private: parentObj "void* private" Desc=Ptr to parent object
private: arglist "struct _ELFLIST*" Desc=arguments for the desired cmd
private: outputLinks INTEGER Desc=outputs connected to this node
private: flags INTEGER Desc=private flags
private: memoryNode INTEGER Desc=Does this object have a \
xipWriteMem node set, 0=no, 1=yes
private: bytes INTEGER Desc=bytes per entry
private: entries INTEGER Desc=number of entries
private: NODE_ID INTEGER Desc=XFlow node ID
method: getEntryCount Native=XIPINFOMethods@xipsup \
Output=count.INTEGER \
DESC=Gets the number of entries in the XIPINFO object
method: getFieldCount Native=XIPINFOMethods@xipsup \
Output=count.INTEGER \
DESC=Gets the number of fields associated with an entry
method: findField Native=XIPINFOMethods@xipsup \
Input=name.STRING, type.STRING \
Output=field.INTEGER \
DESC=Finds a given field and returns the index position of the field, zero \
reference. The \"type\" value is one of the basic types, i.e., i, s, f for \
INTEGER, STRING, DOUBLE
method: getFieldName Native=XIPINFOMethods@xipsup \
Input=field.INTEGER \
Output=name.STRING \
DESC=Gets the name of the given field at the field index position
method: getFieldType Native=XIPINFOMethods@xipsup \
Input=field.INTEGER \
Output=type.STRING \
DESC=Gets the type of the given field at the field index position
method: getFieldSize Native=XIPINFOMethods@xipsup \
Input=field.INTEGER \
Output=size.INTEGER \
DESC=Gets the size of the given field at the field index position
method: getFieldInt Native=XIPINFOMethods@xipsup \
Input=entry.INTEGER, index.INTEGER, field.INTEGER \
Output=value.INTEGER \
DESC=Gets the index of the given field for the given entry. For ex, if \
the field \"parts\" typically has 3 values. The \"index\" \
would be 0, 1, 2 respectively to access them.
method: getFieldDouble Native=XIPINFOMethods@xipsup \
Input=entry.INTEGER, index.INTEGER, field.INTEGER \
Output=value.DOUBLE \
DESC=Gets the index of the given field for the given entry; similar \
to getFieldInt
method: getFieldStr Native=XIPINFOMethods@xipsup \
Input=entry.INTEGER, field.INTEGER \
Output=value.STRING \
DESC=Gets the given field for the given entry; similar to getFieldInt but\
without an index
method: getFieldList Native=XIPINFOMethods@xipsup \
Input=entry.INTEGER, field.INTEGER \
Output=value.LIST \
DESC=Gets the given field for the given entry. It will return the entire\
field in a list.
method: toString Native=XIPINFOMethods@xipsup \
Output=output.STRING \
DESC=Converts all the XIPINFO data to a single string
method: seq2infoList Native=XIPMethods@xipsup \
Output=list.LIST \
Desc=!__XIPMethod_seq2infoList Convert XIPINFO sequence \
into an LIST of discrete XIPINFO objects.
method: exec Native=XIPMethods@xipsup \
Input=save.STRING, perfLog.s, perfLevel.i, watchdog.i \
Output=info.XIPINFO \
Desc=Execute the image path workflow to get the \
output info object.
desc: {
// DESCRIPTION
The XIPINFO object is alternative content data returned from XEngines. Its methods access this data.
XEngine Info Objects are a flat structure layout used by XEngines to return non-image data. The info data
pseudo header contains information about the Entries and fields within the Entries. With these methods
all information can be programmatically accessed.
// EXAMPLE using orient_page module
XIPINFO orient = readimage (filename: infile).orient_page();
// Quick way to see all the content of the info
print orient.toString ();
INTEGER i = orient.findField (name: "direction", type: "i");
print "direction index = " + i;
INTEGER dir = orient.getFieldInt (entry: 0, index:0, field: i);
print "Direction is " + dir;
i = orient.findField (name: "confidence", type: "i");
print "confidence index = " + i;
INTEGER con = orient.getFieldInt (entry: 0, index:0, field: i);
print "Confidence is " + con;
An alternative way to see info content is with the "pex" command line application. For any XEngine module
that returns an info object you execute the command line with pex. The example below is for orient_page;
> pex readimage someImageFile : orient_page : dump
Info size: <undefined>
Info blobs: <undefined>
Entries [s c]: 0 <all>
Info fields:
direction: integer - 4 bytes
confidence: integer - 4 bytes
Blob 0:
sl\px
------
Entry 0:
direction: 0
confidence: 0
If instead of orient_page one used histogram, you get the following;
> pex readimage someImageFile : histogram : dump
Info size: 3 entries
Info blobs: <undefined>
Entries [s c]: 0 <all>
Info fields:
separation: integer - 4 bytes
bits: integer - 4 bytes
style: string - 32 bytes
histogram: 256 integers - 1024 bytes
Blob 0:
sl\px
------
Entry 0:
separation: 1
bits: 8
style: "normalized"
histogram: 0 0 0 77 717 2425 3665 5797 3407 3 2894 2936 2340 1946 1668 1313 1586 1264 1153 1191 1126 1017 873 832 1352 803 633 284 739 582 986 529 912 445 867 387 785 657 348 647 643 341 565 623 540 201 190 546 610 526 549 270 459 557 542 593 527 510 495 454 491 487 495 290 292 475 472 502 488 462 433 480 486 434 496 449 571 684 426 426 333 202 283 348 526 595 400 395 350 491 560 396 353 313 496 539 387 349 287 414 326 255 318 378 597 355 309 432 542 313 428 503 315 277 491 483 304 492 198 210 613 692 332 464 950 487 459 877 593 530 640 618 835 522 368 822 553 138 486 785 390 605 643 697 694 303 553 562 571 633 251 465 609 481 479 138 290 525 543 614 300 707 324 545 544 588 596 321 790 313 789 281 543 181 349 549 415 552 289 728 316 765 347 834 349 868 392 785 407 562 429 619 163 271 805 357 907 238 980 192 1009 183 1035 161 1052 149 1090 109 1279 92 850 70 1218 107 1623 119 1914 172 2969 252 1822 522 1103 1114 347 1213 83 1162 59 432 30 605 76 513 118 421 172 104 245 32 318 21 278 37 399 82 471 114 83 408 45 515 21 1722 0 2500
Entry 1:
separation: 2
bits: 8
style: "normalized"
...
// This is how you would access the 11th value of the "histogram" field of "Entry 0" via script;
XIPINFO hist = readimage (filename: infile).histogram();
INTEGER i = hist.findField (name: "histogram", type: "i");
print hist.getFieldInt (entry: 0, index:10, field: i);
// output is
2894
There are many modules that output XIPINFO objects, see the return types for XIPIMAGE methods to be sure of
the return type.
}
[XIPTIMER]
public: startTime DOUBLE Desc=Start time of timer
public: markTime DOUBLE Desc=Last time elapsed method called
public: lapTime DOUBLE Desc=Time elapsed since last call of elapsed method
public: splitTime DOUBLE Desc=Time elapsed since timer was started
public: running BOOLEAN Desc=Current state of timer
method: start Native=XIPTIMERMethods@xipsup \
Output=obj.XIPTIMER \
Desc=Start the timer
method: stop Native=XIPTIMERMethods@xipsup \
Desc=Stop the timer.
method: reset Native=XIPTIMERMethods@xipsup \
Desc=Reset the timer
method: elapsed Native=XIPTIMERMethods@xipsup \
Input=lap.BOOLEAN \
Output=time.DOUBLE \
Desc=!XIPTIMERMethods Returns lap or split time in \
seconds. If lap is TRUE, it returns lap time. If lap \
is FALSE or not specified, it returns split time.
<FUNCTIONS>
function: Execute Native=GraphExecute@xipsup \
Input=save.s, perfLog.s, perfLevel.i, watchdog.i \
DESC=!GraphExecute Execute the current state. Resolves all differed \
processing for image processing connections that end with a terminal \
node, e.g., writexxx.
function: LoadClasses Native=LoadClasses@xipsup \
Input=filename.s, list.LIST, \
exlist.LIST, dynamicObjs.i \
DESC=Loads XEngine modules as static functions and objects, or methods \
of XIPIMAGE object. The \"filename\" is the library name of a dynamically \
registerable XEngine library.
function: MD5 Native=XIPSMD5@xipsup Input=filename.STRING, obj.OBJECT \
Output=str.STRING \
Desc=Implementation of Message Digest algorithm 5 to CRC. Widely used \
cryptographic hash function with a 128-bit hash value. The value is \
returned as hex values printed to a STRING object.
function: SHA1 Native=XIPSSHA1@xipsup Input=filename.STRING, \
str.STRING, obj.OBJECT \
Output=str.STRING \
Desc=Implementation of Secure Hash Algorithm 1, a \
cryptographic hash function with a 160-bit hash value. \
The value is returned as base64 value printed to a \
STRING object.
function: ReadObject Native=ReadObject@xipsup \
Input=filename.STRING, override.i \
Output=this.OBJECT
function: ReadIMS Native=XIPReadIMS@xipsup \
Input=filename.STRING, list.BOOLEAN, deferred.BOOLEAN \
Output=img.OBJECT
function: WriteIMS Native=XIPWriteIMS@xipsup \
Input=filename.STRING, img.XIPIMAGE
function: ScriptExec Native=ScriptExec@xipsup \
Input=filename.s, import.LIST, export.LIST \
Output=userdef.OBJECT \
DESC=!ScriptExec Execute a script
function: System Native=ELFSystem@xipsup \
Input=cmd.STRING, mode.STRING \
Output=obj.OBJECT \
DESC=!ELFSystem Execute a system call
function: TimeCheck Native=XIPSTimeChk@xipsup \
Output=time.s \
DESC=!XIPSTimeChk Returns a string with the current \
execution time relative to the start of XIPSExecute.